<?php
//party的REST SERVER
//require_once(dirname(__FILE__)."/../src/party_mod_getindustryinfo.php");
require_once(dirname(__FILE__)."/../src/party_mod_create_one_party.php");
require_once(dirname(__FILE__)."/../src/party_mod_insert_party_baseinfo.php");
require_once(dirname(__FILE__)."/../src/party_mod_get_party_baseinfo.php");
require_once(dirname(__FILE__)."/../src/party_mod_get_partyArray_by_industryid.php");
require_once(dirname(__FILE__)."/../src/party_mod_init_get_homepageid.php");
require_once(dirname(__FILE__)."/../src/party_mod_update_message.php");
require_once(dirname(__FILE__)."/../src/party_mod_get_message.php");
require_once(dirname(__FILE__)."/../src/party_mod_insert_partyfacility.php");
require_once(dirname(__FILE__)."/../src/party_mod_get_industryName.php");
require_once(dirname(__FILE__)."/../src/party_mod_search_party.php");
require_once(dirname(__FILE__)."/../src/party_mod_send_dianping.php");
require_once(dirname(__FILE__)."/../src/party_mod_get_dianping.php");

if($_SERVER['REQUEST_METHOD'] == "POST")
{
	switch ($_POST['act'])
	{
		case 'post_party_image': //please change the case value to your service name
			//To do;
		    echo "<h1>POST  post_party_image成功啦{$_POST['arg0']}</h1>"; //this is an example
		    break;
		case 'tttt':           //please change the case value to your service name
			//To do;
    		echo "<h1>POST  tttt成功啦</h1>"; //this is an example
		    break;
		
		case 'insert_party_baseinfo':
			echo insert_party_baseinfo( $_POST['partyid'], $_POST['des'] );
		    break;

		case 'init_get_homePageId':
			echo init_get_homepageid( $_POST['partyid'], $_POST['email_account'] );
		    break;

	    case 'update_message':
			echo update_message( $_POST['pageId'], $_POST['message'] );
		    break;

	    case 'insert_partyfacility':
			echo insert_partyfacility( $_POST['partyid'], $_POST['facilityid'] );
		    break;
        
		case 'send_dianping':
		    echo send_dianping( $_POST['star'], $_POST['content'], $_POST['party_email'] );
			break;
		
		default:
			echo  'FALSE';
			break;
	}

}
else if($_SERVER['REQUEST_METHOD'] == "GET")
{
    switch ($_GET['act'])
	{
//		case 'get_party_info':
			//To do;
//		  echo "<h1>GET  post_party_info成功啦{$_GET['arg0']}{$_GET['arg1']}</h1>"; //this is an example
//		  break;
//        case 'GetIndustryInfo':				 
//		  echo GetIndustryInfo();		  
//		 break;		
//		case 'get_party':	
//		 echo GetParty($_GET);
//		 break;

	    case 'create_one_party':
			echo create_one_party( $_GET['partyname'] );
			break;
		case 'get_party_baseinfo':
			echo get_party_baseinfo( $_GET['partyid'] );
		    break;
			
	    case 'get_party_by_industryid':				
			echo GetPartyArrayByIndustryId($_GET);
			break;
	    case 'get_message':
			echo get_message( $_GET['pageId'] );
		    break;

		case 'get_industryName':
			echo get_industryName( $_GET['industryId'] );
		    break;

         case 'party_search':		
			echo GetPartyForSearch($_GET);
		    break;
		    

		case 'get_dianping':
			echo get_dianping( $_GET['party_email'], $_GET['page'] );
		    break;

		default:
			echo  'FALSE';
			break;
	}
}
else
{
	echo 'FALSE';
}

?>